import { BasicColumn, FormSchema } from '@/components/Table';
import { useI18n } from '@/hooks/web/useI18n';

const { t } = useI18n();

export const scriptColumns: BasicColumn[] = [
  {
    title: t('sys.script.title'),
    dataIndex: 'name',
    width: 150,
  },
  {
    title: t('sys.orientation.quantity'),
    dataIndex: 'quantity',
    width: 100,
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
    width: 50,
  },
];
export const monitoringColumns: BasicColumn[] = [
  {
    title: 'Id',
    dataIndex: 'id',
    width: 150,
  },
  {
    title: 'node',
    dataIndex: 'node',
    width: 100,
  },
  {
    title: t('sys.informaionMatchaing.columns.createTime'),
    dataIndex: 'createdAt',
    width: 100,
  },
  {
    title: t('sys.analysis.columns.status'),
    dataIndex: 'status',
    width: 50,
  },
  {
    title: t('sys.device.columns.remck'),
    dataIndex: 'remark',
    width: 100,
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
    width: 100,
  },
];
export const taskLogColumns: BasicColumn[] = [
  {
    title: t('sys.script.columns.name'),
    dataIndex: 'name',
  },
  {
    title: t('sys.device.columns.devicecode'),
    dataIndex: 'name',
  },
  {
    title: t('sys.log.logType'),
    dataIndex: 'logType',
  },
  {
    title: t('sys.analysis.columns.status'),
    dataIndex: 'status',
  },
  {
    title: t('sys.script.columns.creadTime'),
    dataIndex: 'cread_time',
  },
  {
    title: t('sys.script.columns.endTime'),
    dataIndex: 'end_time',
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
  },
];
export const systemLogColumns: BasicColumn[] = [
  {
    title: t('sys.userlist.columns.taskId'),
    dataIndex: 'taskId',
  },
  {
    title: t('sys.script.columns.name'),
    dataIndex: 'uname',
  },
  {
    title: t('sys.log.logType'),
    dataIndex: 'logType',
  },
  {
    title: t('sys.code.status'),
    dataIndex: 'isRead',
  },
  {
    title: t('sys.script.columns.creadTime'),
    dataIndex: 'createTime',
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
  },
];
export const operationLogColumns: BasicColumn[] = [
  {
    title: t('sys.log.name'),
    dataIndex: 'name',
  },
  {
    title: t('sys.log.userAction'),
    dataIndex: 'userAction',
  },
  {
    title: t('sys.configuration.describe'),
    dataIndex: 'reamk',
  },
  {
    title: t('sys.script.columns.creadTime'),
    dataIndex: 'cread_time',
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
  },
];
export const taskErrorColumns: BasicColumn[] = [
  {
    title: t('sys.script.columns.name'),
    dataIndex: 'name',
  },
  {
    title: t('sys.log.logerrorType'),
    dataIndex: 'logType',
  },
  {
    title: t('sys.log.message'),
    dataIndex: 'message',
  },
  {
    title: t('sys.script.columns.creadTime'),
    dataIndex: 'cread_time',
  },
  {
    title: t('sys.script.columns.endTime'),
    dataIndex: 'end_time',
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
  },
];
export const taskSeverColumns: BasicColumn[] = [
  {
    title: t('sys.script.columns.name'),
    dataIndex: 'name',
  },
  {
    title: t('sys.script.columns.deiveName'),
    dataIndex: 'deiveName',
  },
  {
    title: t('sys.log.scriptversions'),
    dataIndex: 'versions',
  },
  {
    title: t('sys.script.columns.creadTime'),
    dataIndex: 'cread_time',
  },
  {
    title: t('sys.script.columns.endTime'),
    dataIndex: 'end_time',
  },
  {
    title: t('sys.device.columns.remck'),
    dataIndex: 'reamk',
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
  },
];
// 表头数据
export const configcolumns: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'id',
    width: 30,
  },
  {
    title: t('sys.script.columns.deviceCode'),
    dataIndex: 'deviceNo',
    width: 100,
  },
  {
    title: t('sys.script.columns.name'),
    dataIndex: 'deviceAlias',
    width: 100,
  },
  {
    title: t('sys.informaionMatchaing.columns.category'),
    dataIndex: 'deviceGroup',
    width: 100,
  },
  {
    title: t('sys.log.deviceNodeNum'),
    dataIndex: 'deviceNodeNum',
    width: 100,
  },
  {
    title: t('sys.log.lastHeartbeatTime'),
    dataIndex: 'lastHeartbeatTime',
    width: 100,
  },
  {
    title: 'IP',
    dataIndex: 'deviceIp',
    width: 100,
  },
  {
    title: t('sys.script.columns.version'),
    dataIndex: 'deviceVersion',
    width: 100,
  },
  {
    title: 'MAC',
    dataIndex: 'deviceMac',
    width: 100,
  },
  {
    title: t('sys.configuration.describe'),
    dataIndex: 'deviceDesc',
    width: 120,
  },
  // {
  //   title: t('sys.code.title'),
  //   dataIndex: 'code',
  //   width: 50,
  // },
  {
    title: t('sys.log.devivceStatus'),
    dataIndex: 'deviceStatus',
    width: 180,
  },
  {
    title: t('sys.log.progress'),
    dataIndex: 'progress',
    width: 100,
  },
  {
    title: t('sys.device.columns.validTime'),
    dataIndex: 'validTime',
    width: 100,
  },
  {
    title: t('sys.code.columns.account'),
    dataIndex: 'account',
    width: 100,
  },
  {
    title: t('sys.device.columns.remck'),
    dataIndex: 'remark',
    width: 100,
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
    width: 200,
  },
];
export const verificationcolumns: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'id',
    width: 30,
  },
  {
    title: 'mac',
    dataIndex: 'mac',
    width: 100,
  },
  {
    title: 'node',
    dataIndex: 'node',
    width: 100,
  },
  {
    title: t('sys.log.verificat'),
    dataIndex: 'verifyCode',
    width: 120,
  },
  {
    title: t('sys.log.verificatKey'),
    dataIndex: 'verifyCodeKey',
    width: 50,
  },
  {
    title: t('sys.analysis.columns.status'),
    dataIndex: 'verifyCodeType',
    width: 80,
  },
  {
    title: t('sys.device.columns.validTime'),
    dataIndex: 'validTime',
    width: 50,
  },
  {
    title: t('sys.code.columns.account'),
    dataIndex: 'attributionAccount',
    width: 80,
  },
  {
    title: t('sys.device.columns.remck'),
    dataIndex: 'remark',
    width: 50,
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'action',
    width: 50,
  },
];
export const columnsError: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'id',
    width: 30,
  },
  {
    title: t('sys.device.columns.devicecode'),
    dataIndex: 'device',
    width: 50,
  },
  {
    title: t('sys.device.columns.version'),
    dataIndex: 'version',
    width: 30,
  },
  {
    title: t('sys.device.columns.type'),
    dataIndex: 'label',
    width: 30,
  },
  {
    title: t('sys.device.columns.time'),
    dataIndex: 'date',
    width: 50,
  },
  {
    title: t('sys.device.columns.valueXui'),
    dataIndex: 'valueXui',
    width: 50,
  },
  {
    title: t('sys.device.columns.valuePng'),
    dataIndex: 'valuePng',
    width: 50,
  },
  {
    title: t('sys.device.columns.log'),
    dataIndex: 'type',
    width: 50,
  },
];

export const accountFormSchema: FormSchema[] = [
  {
    field: 'device',
    component: 'Input',
    label: t('sys.device.columns.devicecode'),
    defaultValue: '',
    rules: [{ required: true }],
  },
  {
    field: 'authorizationCode',
    component: 'Input',
    label: t('sys.code.title'),
    defaultValue: '',
    rules: [{ required: true }],
  },
];

// 基础字段
export const configTaskNumcolumns: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'id',
    width: 30,
  },

  {
    title: t('sys.device.columns.devicename'),
    dataIndex: 'device',
    width: 100,
  },
  {
    title: t('sys.configuration.describe'),
    dataIndex: 'remark',
    width: 120,
  },
  {
    title: t('sys.log.windownstatus'),
    dataIndex: 'status',
    width: 100,
  },
  {
    title: t('sys.device.columns.validTime'),
    dataIndex: 'createTime',
    width: 50,
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'options',
    width: 50,
  },
];
export const gatherTaskNumdataSourcm = [
  {
    id: '1',
    value: '1',
    device: 'ffsju234tgmgmfgf123455',
    status: '1',
    createTime: '2024-06-20 12:00:00',
    remark: '推特',
  },
  {
    id: '2',
    device: 'ffsju234tgmgmfgf123455',
    status: '0',
    createTime: '2024-06-20 12:00:00',
    remark: '谷歌',
  },
  {
    id: '2',
    device: 'ffsju234tgmgmfgf123455',
    status: '0',
    createTime: '2024-06-20 12:00:00',
    remark: '谷歌',
  },
];

export const configTaskcountcolumns: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'id',
    width: 30,
  },

  {
    title: t('sys.log.taskName'),
    dataIndex: 'name',
    width: 100,
  },

  {
    title: t('sys.log.PlatformName'),
    dataIndex: 'remark',
    width: 100,
  },
  {
    title: t('sys.informaionMatchaing.columns.status'),
    dataIndex: 'status',
    width: 100,
  },
  {
    title: t('sys.script.columns.creadTime'),
    dataIndex: 'createTime',
    width: 50,
  },
  {
    title: t('sys.configuration.action'),
    dataIndex: 'options',
    width: 50,
  },
];
export const gatherTaskcountdataSource = [
  {
    id: '1',
    name: '采集任务1',
    status: '1',
    createTime: '2024-06-20 12:00:00',
    remark: '推特',
  },
  {
    id: '2',
    name: '采集任务2',
    device: 'ffsju234tgmgmfgf123455',
    status: '0',
    createTime: '2024-06-20 12:00:00',
    remark: '谷歌',
  },
  {
    id: '2',
    name: '采集任务3',
    device: 'ffsju234tgmgmfgf123455',
    status: '2',
    createTime: '2024-06-20 12:00:00',
    remark: '谷歌',
  },
];
// 设置备注字段
export const remarkFormSchema = [
  {
    field: 'owner',
    label: t('sys.device.columns.remck'),
    component: 'Input',
    colProps: { span: 24 },
  },
];
